// MemBufManager.h: interface for the CMemBufManager class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_MEMBUFMANAGER_H__20639638_B324_4D4E_92B1_15E6436C92CE__INCLUDED_)
#define AFX_MEMBUFMANAGER_H__20639638_B324_4D4E_92B1_15E6436C92CE__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000


struct SMemData
{
	BYTE	*pBuffer;
	int		nCurSize;
};

typedef	std::list<SMemData>	MemDatas;

class CMemBufManager  
{
public:
	CMemBufManager();
	virtual ~CMemBufManager();

protected:
	MemDatas	m_Buffers;

	SMemData&	_AddBuffer();

public:
	void		Clear();
	BYTE*		GetBuffer(int nNeedSize);
	char*		GetStringBuffer(int nLength);

	SMemData&	_FindBuffer(int nNeedSize);

};

#endif // !defined(AFX_MEMBUFMANAGER_H__20639638_B324_4D4E_92B1_15E6436C92CE__INCLUDED_)
